package main

import "encoding/json"

// Command "project" specify your project to generate
// Field Rule tag
// Except rule tag any others tag will be as fields tag. for example: you use http parameter validator
// Parameter: represent this field is a parameter
// Required: represent this field is required parameter
// AutoGenGormTag: generator will auto generate gorm's tag. if not specify this rule and not specify gorm's or others orm's tag the field's tag will be empty
// NameStyle: you can specify the json tag naming style as snake_case or camelCase or you can directly specify json tag
// EnableValidator: enable http parameter validator, but you must specify validator tag. if you have no this validator tag EnableValidator is invalid

//generate:bll;model;entity;api.http;store.postgres
//project:simcard
type Prepaid struct {
	Id            int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	PaymentId     int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EbikeId       int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Sn            string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EffectiveDate string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	ExpiredDate   string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Status        int    `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CreatedAt     int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UpdatedAt     int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
}

//generate:bll;model;entity;api.http;store.postgres
//project:simcard
type SimCard struct {
	Id            int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UserId        int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UserPhone     string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	AgentId       int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Sn            string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	FrameCode     string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Iccid         string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EffectiveDate string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	ExpiredDate   string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Status        int             `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Detail        json.RawMessage `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CreatedAt     int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UpdatedAt     int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
}

//generate:bll;model;entity;api.http;store.postgres
//project:simcard
type SimCardAgent struct {
	Id          int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Name        int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Code        string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Description string `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Balance     int32  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CreatedAt   int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UpdatedAt   int64  `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
}

//generate:bll;model;entity;api.http;store.postgres
//project:simcard
type SimCardRechargeRecord struct {
	Id          int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	EbikeId     int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CardId      int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	AgentId     int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	AgentDetail json.RawMessage `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Iccid       string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	RechargeAt  int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Status      int             `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	Reason      string          `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	CreatedAt   int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
	UpdatedAt   int64           `rule:"Parameter;AutoGenGormTag;NameStyle:snake_case"`
}
